import 'package:FlipClock/controller/controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class SettingsButton extends StatelessWidget {
  const SettingsButton({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final Controller c = Get.put(Controller());

    return Obx(
      () => Offstage(
        offstage: c.isHiddenButton.value,
        child: AnimatedOpacity(
          opacity: c.showOpacity.value,
          duration: Duration(milliseconds: 300),
          child: IconButton(
            padding: EdgeInsets.all(0),
            icon: Icon(
              Icons.settings,
              size: Theme.of(context).iconTheme.size,
              color: Theme.of(context).iconTheme.color,
            ),
            onPressed: () => {Get.toNamed('/settings')},
          ),
        ),
      ),
    );
  }
}
